<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Pownce API JavaScript lib Demo</title>
        <link type="text/css" media="all" href="main.css" rel="stylesheet"/>
    </head>
    <body>
    	<!-- json.js is just used to show the resulting json. not needed for pownce api -->
        <script src="json.js" type="text/javascript"></script>
        <script src="../pownce.api-2.0.lib.js" type="text/javascript">
        </script>
        <h2>Raw JSON data</h2>
        <p>
            You can include JSON data for your page by simply adding the following code.
        </p>
        <h3>User Profile</h3>
        <h4>CODE:</h4>
        <pre>
&lt;script language="Javascript">
    var returnFunction = function() {
        // Do something with the JSON
        var user = pownce.api.json.userprofile;
    };

    // Load the public notes list JSON
    pownce.api.user.profile({username:"dburka", onCallBack: returnFunction});

&lt;/script>
		</pre>
        <h4>RESULT:</h4>
        <pre id="userprofilejsoncode">
        </pre>
        <script language="Javascript">
        	
			var returnFunction = function() {
                // Do something with the JSON
                var user = pownce.api.json.userprofile;

				var strjson = JSON.stringify(user);
				strjson = strjson.replace(/{/g, "{<br/>");
				strjson = strjson.replace(/}/g, "}<br/>");
				strjson = strjson.replace(/,\"/g, ",<br/>\"");
                document.getElementById("userprofilejsoncode").innerHTML = strjson;
			};
			
            // Load the public notes list JSON
		    pownce.api.user.profile({username:"dburka", onCallBack: returnFunction});
			
        </script>
        <h3>Public Notes List</h3>
        <h4>CODE:</h4>
        <pre>
&lt;script language="Javascript">
    var returnFunction = function() {
        // Do something with the JSON
        var json = pownce.api.json.publicnotelist;
    };

    // Load the public notes list JSON
    pownce.api.notes.publiclist({limit:1, onCallBack: returnFunction});

&lt;/script>
		</pre>
        <h4>RESULT:</h4>
        <pre id="publicnoteslistjsoncode">
        </pre>
        <script language="Javascript">
        	
			var returnFunction = function() {
                // Do something with the JSON
                var json = pownce.api.json.publicnotelist;
				var strjson = JSON.stringify(json);
				strjson = strjson.replace(/{/g, "{<br/>");
				strjson = strjson.replace(/}/g, "}<br/>");
				strjson = strjson.replace(/,\"/g, ",<br/>\"");
                document.getElementById("publicnoteslistjsoncode").innerHTML = strjson;
			};
			
            // Load the public notes list JSON
            pownce.api.notes.publiclist({
                limit: 1, onCallBack: returnFunction
            });
        </script>
        <h3>Public Note</h3>
        <h4>CODE:</h4>
        <pre>
&lt;script language="Javascript">
    var returnFunction = function() {
        // Do something with the JSON
        var note = pownce.api.json.publicnote;
    };

    // Load the public notes list JSON
    pownce.api.notes.publicnote({note_id:"1519078", onCallBack: returnFunction});

&lt;/script>
		</pre>
        <h4>RESULT:</h4>
        <pre id="publicnotejsoncode">
        </pre>
        <script language="Javascript">
        	
			var returnFunction = function() {
                // Do something with the JSON
        		var note = pownce.api.json.publicnote;
				var strjson = JSON.stringify(note);
				strjson = strjson.replace(/{/g, "{<br/>");
				strjson = strjson.replace(/}/g, "}<br/>");
				strjson = strjson.replace(/,\"/g, ",<br/>\"");
                document.getElementById("publicnotejsoncode").innerHTML = strjson;
			};
			
            // Load the public notes list JSON
    		pownce.api.notes.publicnote({note_id:"1519078", onCallBack: returnFunction});
        </script>
    </body>
</html>
